﻿#ifndef FORMITEMWIDGETGROUP_H
#define FORMITEMWIDGETGROUP_H

#include <QWidget>
#include "../utils/groupitemdata.h"

namespace Ui {
class FormItemWidgetGroup;
}

class FormItemWidgetGroup : public QWidget
{
    Q_OBJECT
signals:
    void sig_dataChange(QString,QString);

    void sig_EnableItem(bool);

    void sig_startPut();
public:
    explicit FormItemWidgetGroup(QStringList titlelst = QStringList(""),QWidget *parent = 0);
    ~FormItemWidgetGroup();

    void setCheck(bool flag);
    void setTitle(QString strname,QString strtext);
    QString getTitle(/*groupName*/);
    void setValue(QString strname,QString strtext);
    void setValue(QStringList strlst);
    void setIp(QString str);
    void updateDateTime();

    bool getEnable(){return IsEnableUse;}

    QString getGroupNum();
    bool IsLoadSubItem;

    void setData(GroupItemData &data){m_itemData = data;}
    GroupItemData Data(){return m_itemData;}

    void setStatus(QString str);
    void updateStatus(QString str);//更新连接状态

protected:
    bool eventFilter(QObject *, QEvent *);
    void mousePressEvent();

private:
    Ui::FormItemWidgetGroup *ui;
    bool IsEnableUse;

    GroupItemData m_itemData;
};

#endif // FORMITEMWIDGETGROUP_H
